package org.esti.model.utils;

import org.esti.service.InterviewService;
import org.springframework.beans.factory.annotation.Autowired;

import java.beans.PropertyEditorSupport;

/**
 * @author ALoginov <a href="mailto:Artem.Loginov@exigenservices.com">Artem Loginov</a>
 * @since 11/1/11
 */
public class InterviewPropertyEditor extends PropertyEditorSupport {

    @Autowired
    private final InterviewService interviewService;


    public InterviewPropertyEditor(InterviewService interviewService) {
        this.interviewService= interviewService;
    }


    @Override
    public void setAsText(String idS) {
        Long id = Long.parseLong(idS);
        super.setValue(interviewService.getInterview(id));
    }
}
